package com.business.exam.mapper;

import com.business.exam.domain.ExamQbCategory;
import com.business.exam.domain.ExamQbKnownledgeLabel;
import com.business.exam.domain.question.Question;
import com.business.exam.domain.question.QuestionPageRequestVM;
import com.business.exam.domain.question.QuestionResponseVM;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface QuestionMapper extends BaseMapper<Question> {

    /**
     * 获取题目列表
     */
    List<Question> findDataList(QuestionPageRequestVM requestVM);

    /**
     * 根据ID获取列表
     */
    List<Question> selectByIds(@Param("ids") List<Integer> ids);

    int insert(Question record);

    int insertSelective(Question record);

    ExamQbCategory selectCategoryIdByContent(String gradeLevel);

    ExamQbKnownledgeLabel selectKnowledgeIdByContent(String subjectId);

    /**
     * 获取题目列表
     */
    List<QuestionResponseVM> findDataListForPage(QuestionPageRequestVM requestVM);

    /**
     * 按照题库分类查询所包含的各题型个数
     *
     * @param model
     * @return
     */
    List<Map<String, Object>> selectTotalQuestion(QuestionPageRequestVM model);

    /**
     * 根据标签获取所有题目ID
     *
     * @param paramMap
     * @return
     */
    List<Integer> selectQuestionIdByLabel(Map<String,Object> paramMap);
}
